#include "Classes.h"
#include <iostream>

BigInteger::BigInteger(const std::string& i_str) throw (const std::string&)
{
	m_number=i_str;
};

BigInteger::BigInteger(const BigInteger& i_other) 
{
	m_number = i_other.m_number;
};

std::ostream& operator << (std::ostream& i_os, const BigInteger& i_this)
{
	std::string& s=i_this.m_number.GetStr();
	i_os.write(s.c_str(),s.size());
	return i_os;
};

BigInteger& BigInteger:: operator = (const BigInteger& i_other)
{
	if(this==&i_other)
		return *this;
	this->m_number=i_other.m_number;
	return *this;
};

BigInteger& BigInteger:: operator = (const std::string& i_str) throw (const std::string&)
{
	this->m_number=i_str;
	return *this;
};

bool BigInteger:: operator == (const BigInteger& i_other) const
{
	return (m_number==i_other.m_number);
};

bool BigInteger:: operator < (const BigInteger& i_other) const
{
	return (m_number<i_other.m_number);
};

bool BigInteger:: operator != (const BigInteger& i_other) const
{
	return (!this->operator== (i_other));
};

bool BigInteger:: operator > (const BigInteger& i_other) const
{
	return(i_other.operator< (*this));
};

BigInteger BigInteger::operator + (const BigInteger& i_other)
{
	BigInteger temp;
	temp.m_number=m_number+i_other.m_number;
	return temp;
};

BigInteger BigInteger::operator - (const BigInteger& i_other)
{
	BigInteger temp;
	temp.m_number=m_number-i_other.m_number;
	return temp;
};

BigInteger BigInteger::operator * (const BigInteger& i_other)
{
	BigInteger temp;
	temp.m_number=m_number*i_other.m_number;
	return temp;
};

BigInteger BigInteger::operator / (const BigInteger& i_other)
{
	BigInteger temp;
	temp.m_number=m_number/i_other.m_number;
	return temp;
};